# Django settings for sity project.
import os
PROJECT_DIR = os.path.dirname(__file__)
j = lambda filename: os.path.join(PROJECT_DIR, filename)

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
     ('Sohaib Afifi', 'me@sohaibafifi.com'),
     
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': j('data/sohaibafifi_pyblog.db'), #j('data/sqlite.db') Or path to database file if using sqlite3.
        'USER': 'sohaibafifi', # Not used with sqlite3.
        'PASSWORD': 'bloc63621', # Not used with sqlite3.
        'HOST': 'mysql.alwaysdata.com', # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '', # Set to empty string for default. Not used with sqlite3.
    }
}


TIME_ZONE = 'Africa/Algiers'
LANGUAGE_CODE = 'en-GB'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = j("public/media")
MEDIA_URL = '/media/'
STATIC_ROOT = j("static")
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
SECRET_KEY = '086cjqkk60%$=5!c_6=*1_)by&@s!2q&nm!acbp@qc1im!#hxr'
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    
)
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.request',
    'apps.blog.context_processors.myurl',
)

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = (
    j("templates"),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.flatpages',
    'django.contrib.webdesign',
    'django.contrib.markup',
    'django.contrib.comments',
    'django.contrib.sitemaps',
    'django_extensions',
    'apps.ExtendedFlatPages',
    'apps.smart',
    'apps.iptocountry',
    'apps.blog',
    'apps.captcha',
    'apps.projects',
    'tinymce',
    'mptt',
    #'filebrowser',
    #'south',
    #'debug_toolbar',
  )

DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
)
INTERNAL_IPS = ('127.0.0.1',)
def custom_show_toolbar(request):
    return True # Always show toolbar, for example purposes only.

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
   # 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
   # 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
    'HIDE_DJANGO_SQL': False,
    'TAG': 'div',
}
TINYMCE_DEFAULT_CONFIG = {
    'plugins': "table,spellchecker,paste,searchreplace",
    'theme': "advanced",
}
TINYMCE_SPELLCHECKER = False
TINYMCE_COMPRESSOR = False
TINYMCE_FILEBROWSER = True

RECAPTCHA_PUB_KEY = '6LflG8cSAAAAACUVwweN3Kny3MCccBec_2qHWKYT'
RECAPTCHA_PRIVATE_KEY = '6LflG8cSAAAAAAZSZ3tKOn0I0VWj2lG75Mv7vUvm'
COMMENTS_APP = 'apps.smart'

XMLRPC_METHODS = (
    #('apps.blog.views.tag_list', 'tag_list',),
    ('apps.smart.metaweblog.get_users_blogs',     'blogger.getUsersBlogs'),
    #('apps.smart.metaweblog.get_user_info',     'blogger.getUserInfo'),
    #('apps.smart.metaweblog.delete_post',     'blogger.deletePost'),
    #('apps.smart.metaweblog.get_authors',     'wp.getAuthors'),
    #('apps.smart.metaweblog.new_category',     'wp.newCategory'),
    ('apps.smart.metaweblog.get_categories',     'metaWeblog.getCategories'),
    ('apps.smart.metaweblog.get_recent_posts',     'metaWeblog.getRecentPosts'),
    ('apps.smart.metaweblog.get_post',     'metaWeblog.getPost'),
    ('apps.smart.metaweblog.new_post',     'metaWeblog.newPost'),
    ('apps.smart.metaweblog.edit_post',     'metaWeblog.editPost'),
    ('apps.smart.metaweblog.new_media_object',     'metaWeblog.newMediaObject'),
)
UPLOAD_TO = 'uploads'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}
